<template>
  <el-table
    :data="cartData"
    style="width: 100%">
    <el-table-column
      label="项目"
      prop='name'
      width="180">
    </el-table-column>
    <el-table-column
      label="单价"
      prop='price'
      width="180">
    </el-table-column>
    <el-table-column label="数量">
      <template slot-scope="scope">
        <el-input-number v-model="scope.row.num" :min="0" label="描述文字"></el-input-number>
      </template>
    </el-table-column>
    <el-table-column label="数量">
      <template slot-scope="scope">
        <span>¥{{scope.row.num * scope.row.price}}</span>
      </template>
    </el-table-column>
  </el-table>
</template>
 
<script lang='ts'>
// 表格
import { Component, Vue, Prop } from 'vue-property-decorator'
@Component({})
export default class extends Vue {
 @Prop({
   type: Array,
   default() {
     return []
   }
 })
 cartData: any[]
}
</script>